package Function;

import book.BookList;

import java.util.Scanner;

public class Bring implements All {
    @Override
    public void work(BookList book) {

        System.out.println("请输入你要还的书名:");
        Scanner in=new Scanner(System.in);
        String bookname2=in.nextLine();
        for(int i=0;i<book.getCount();i++){
            if(bookname2.equals(book.getBook1(i).getName())&&"已借出".equals(book.getBook1(i).getBorrow())){
                book.getBook1(i).setBorrow("未借出");
                System.out.println("归还成功！！！！！");
                return;
            }
        }
        System.out.println("对不起没有找到你要归还的书，您是不是搞错了？");
        return;
    }
}
